home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Online / smbfs / smbfs.doc < prev    next >
Text File  |  2001-06-26  |  20KB  |  446 lines

  1. A SMB file system wrapper for AmigaOS, using the AmiTCP V3 API
  2. ==============================================================
  3.  
  4. 1. What is it?
  5.  
  6. This document briefly describes the SMBFS program, which implements an SMB
  7. file system for AmigaOS. This file system can be used to access files made
  8. available by file servers which implement the SMB protocol, such as 'Microsoft
  9. Windows' or any other platform which supports the free 'Samba' product. These
  10. files can be accessed using shell commands such as 'List', the Workbench or
  11. utilities such as 'Directory Opus' as if the file server were a local disk
  12. drive.
  13.  
  14.  
  15. 2. What do you need to get started?
  16.  
  17. You need a TCP/IP stack that supports the AmiTCP V3 API, such as 'Miami', the
  18. original free 'AmiTCP 3.0' release, 'AmiTCP 4.x', 'Miami Deluxe' or 'AmiTCP
  19. Genesis' and the obligatory networking gear. All these items need to be in
  20. good shape and properly configured.
  21.  
  22. Most important, you need a computer which exports file sharing services using
  23. the SMB protocol.
  24.  
  25. It often helps to have 'Samba' installed on your Amiga, too, as this can aid
  26. in tracking down bugs and obtaining information which SMBFS cannot obtain all
  27. by itself.
  28.  
  29. Last but not least, you need to be proficient in configuring and using the
  30. TCP/IP stack; networking knowledge is definitely assumed.
  31.  
  32. SMBFS requires AmigaOS 2.04 or higher to work.
  33.  
  34.  
  35. 3. Preparations
  36.  
  37. You need to know which computer's files you want to share using the SMBFS file
  38. system. That computer must be known by name, it is not sufficient just to know
  39. its IP address. If you know the IP address but cannot refer to the host by its
  40. name then SMBFS will not work. In that case, make sure that you add a host
  41. name entry referring to the IP address to your TCP/IP stack's host database
  42. (e.g. the "AmiTCP:bin/hosts" file or the corresponding page in the stack's
  43. configuration user interface).
  44.  
  45. The name of the computer to connect to must not be too long. If it is longer
  46. than 16 characters, SMBFS will not work properly.
  47.  
  48. You need to know which service you want to connect to on the target computer.
  49. You can find out which services are available on a certain computer by using
  50. the Samba 'smbclient' program. For example, if you were to query the services
  51. offered by a machine called 'sourcery' you could enter the following:
  52.  
  53.    samba:bin/smbclient -L sourcery
  54.  
  55. And you might get the following information:
  56.  
  57.    added interface ip=192.168.0.1 bcast=192.168.0.255 nmask=255.255.255.0
  58.    Password: Domain=[ARBEITSGRUPPE] OS=[AmigaOS] Server=[Samba 2.0.7]
  59.  
  60.            Sharename      Type      Comment
  61.            ---------      ----      -------
  62.            All            Disk      All volumes in the system
  63.            IPC$           IPC       IPC Service (Amiga 3000UX)
  64.            olsen          Disk      Home Directories
  65.  
  66.            Server               Comment
  67.            ---------            -------
  68.            SOURCERY             Amiga 3000UX
  69.  
  70.            Workgroup            Master
  71.            ---------            -------
  72.            ARBEITSGRUPPE        SOURCERY
  73.    
  74. The share name to connect to would be "ALL" in this case.
  75.  
  76. You need to know which login name and which password are required to connect
  77. to the shared resource, and you need to know the name of the workgroup or
  78. domain the file server is a member of.
  79.  
  80.  
  81. 4. Starting and stopping the file system
  82.  
  83. SMBFS is an uncommon kind of file system in that you do not use the 'Mount'
  84. command to mount it. In fact, SMBFS is a shell program which can be launched
  85. from the shell, using command line parameters to tell it which resources
  86. should be used. But you can also start it from Workbench: in this case you
  87. would have to put the program's command line options into icon tool types.
  88.  
  89. By now you should have assembled the following information:
  90.  
  91.    - Name of the computer to connect to; this would be the
  92.      file server
  93.    - Name of the shared SMB resource to connect to
  94.    - Login name and password
  95.  
  96. That's basically everything you need to know to continue -- unless something
  97. goes wrong, but more on that lateron.
  98.  
  99. Now you can start the file system. For example, to connect to the file server
  100. called 'sourcery' and the shared 'all' resource it exports, with that computer
  101. being a member of the workgroup 'Arbeitsgruppe', using the login name
  102. 'PCGuest' and not providing any password you would enter the following:
  103.  
  104.    Run >NIL: SMBFS Workgroup=Arbeitsgruppe User=PCGuest Service=//sourcery/all
  105.  
  106. This would cause a new device by the name of "SMBFS:" to be mounted, showing
  107. all files and directories the 'sourcery' server makes available for sharing.
  108.  
  109. How do you 'unmount' the file system? That's very easy, just check the output
  110. of the 'Status' shell command. You might get the following output:
  111.  
  112.    Process  1: Loaded as command: TURBOTEXT
  113.    Process  2: Loaded as command: Work:Tools/Blowup
  114.    Process  3: Loaded as command: Work:Tools/Sashimi
  115.    Process  4: Loaded as command: Work:CyberTools/CyberGuard
  116.    Process  5: Loaded as command: Work:Tools/OpenDevicePatch
  117.    Process  6: Loaded as command: CED
  118.    Process  7: Loaded as command: Workbench
  119.    Process  8: Loaded as command: Status
  120.    Process  9: No command loaded
  121.    Process 10: Loaded as command: SMBFS '//sourcery/all'
  122.  
  123. Look at the last line describing process number 10: it shows the name of the
  124. file system program SMBFS and the name of the SMB share it is connected to. To
  125. stop this file system and effectively unmount it, use the shell 'Break'
  126. command; in this case you would enter "Break 10" to stop the file system. Note
  127. that the program may not terminate immediately; it may have to wait until the
  128. last client has released all resources referring to the file system. You may
  129. have to send more than one "Break" command to stop the program.
  130.  
  131.  
  132. 5. Startup options
  133.  
  134. The SMBFS program supports a number of command line options, as will be
  135. described below. The command template looks like this:
  136.  
  137.    DOMAIN=WORKGROUP/K,USER=USERNAME/K,PASSWORD/K,CHANGECASE/S,
  138.    CASE=CASESENSITIVE/S,OMITHIDDEN/S,QUIET/S,CLIENT=CLIENTNAME/K,
  139.    SERVER=SERVERNAME/K,DEVICE=DEVICENAME/K,VOLUME=VOLUMENAME/K,
  140.    CACHE=CACHESIZE/N/K,DEBUGLEVEL=DEBUG/N/K,TZ=TIMEZONEOFFSET/N/K,
  141.    TRANSLATE=TRANSLATIONFILE/K,SERVICE/A
  142.  
  143. The individual options serve the following purposes:
  144.  
  145.    DOMAIN=WORKGROUP/K
  146.  
  147.       You must specify the name of the workgroup or domain the file server to
  148.       connect to is a member of. The name of this workgroup or domain must not
  149.       be longer than 16 characters. The name you provide will be translated to
  150.       all upper case characters.
  151.  
  152.       You need not provide for a work group or domain name on the command line.
  153.       Alternatively, you may configure an environment variable whose contents
  154.       will be used instead. The variable could be set up like this:
  155.  
  156.          SetEnv smbfs_workgroup <name of domain or workgroup>
  157.          Copy ENV:smbfs_workgroup ENVARC:
  158.  
  159.       You may also use the 'smbfs_domain' environment varilable in place of the
  160.       'smbfs_workgroup' variable. The two are aliases for one another, but
  161.       smbfs will read only one of the two.
  162.  
  163.    USER=USERNAME/K
  164.  
  165.       To connect to an SMB share you must authenticate yourself by providing a
  166.       user name. With this program the user name is optional; if you do not
  167.       provide one, SMBFS will use the default, which is "GUEST". The user name
  168.       must not be longer than 64 characters. The name you provide will be
  169.       translated to all upper case characters.
  170.  
  171.       You need not provide for a user name on the command line. Alternatively,
  172.       you may configure an environment variable whose contents will be used
  173.       instead. The variable could be set up like this:
  174.  
  175.          SetEnv smbfs_username <your user name>
  176.          Copy ENV:smbfs_username ENVARC:
  177.  
  178.       You may also use the 'smbfs_user' environment varilable in place of the
  179.       'smbfs_username' variable. The two are aliases for one another, but
  180.       smbfs will read only one of the two.
  181.  
  182.    PASSWORD/K
  183.  
  184.       As part of the authentication process required to make the connection to
  185.       an SMB share, you must provide for a user name and a password. The
  186.       password is optional; if you do not provide one, an empty password will
  187.       be transmitted. The password must not be longer than 64 characters.
  188.  
  189.       You need not provide for a password on the command line. Alternatively,
  190.       you may configure an environment variable whose contents will be used
  191.       instead. The variable could be set up like this:
  192.  
  193.          SetEnv smbfs_password <your password>
  194.          Copy ENV:smbfs_password ENVARC:
  195.  
  196.       Keep in mind that passwords like these really should not be exposed by
  197.       storing them in environment variables. But then the protocol smbfs uses
  198.       is almost as insecure as it gets anyway.
  199.  
  200.       The authentication process only works if the machine you are connecting
  201.       to knows about the user name and password you want to use. As of this
  202.       writing, smbfs cannot be used for authenticating against a password
  203.       server that is not the same machine as the one from which you wish to
  204.       import a share.
  205.  
  206.    CHANGECASE/S
  207.  
  208.       By default the password will not be changed to all upper case characters.
  209.       If this is required, you should either provide the password in this
  210.       form or resort to this option, which will cause it to be translated
  211.       to all upper case characters.
  212.  
  213.    CASE=CASESENSITIVE/S
  214.  
  215.       Some file servers treat file and directory names differently which
  216.       differ only in whether they are written using upper/lower case
  217.       characters. For these servers you should activate the CASESENSITIVE
  218.       switch to treat those files properly. There is a catch though: the
  219.       AmigaDOS file naming scheme does not follow this model and you may
  220.       run into problems when you are trying to use it. By default, the
  221.       file system does not treat file and directory names differently
  222.       which only differ with respect to the case of letters.
  223.  
  224.    OMITHIDDEN/S
  225.  
  226.       When requesting a directory listing, the server may return some files
  227.       and directories tagges as being hidden. By default this file system
  228.       will report these 'hidden' entries anyway, but you can request
  229.       specifically that what is intended to be hidden should be omitted
  230.       from directory listings, too. Note that even though a file may be
  231.       hidden you should still be able to open and examine it.
  232.  
  233.    QUIET/S
  234.  
  235.       When started from Shell, SMBFS will print a message as soon as the
  236.       connection to the file server has been established. If you do not
  237.       want to see that message displayed, use the QUIET parameter. Also,
  238.       no such message will appear if the program has been started to run
  239.       in the background.
  240.  
  241.    CLIENT=CLIENTNAME/K
  242.  
  243.       SMBFS will attempt to connect to the file server by providing the name
  244.       of the computer you connect from. In some cases this may be undesirable
  245.       as the computer's name differs from what the file server expects. You
  246.       can use the CLIENT parameter to tell SMBFS under which name it should
  247.       announce itself to the server. This parameter is optional and will be
  248.       translated to all upper case characters; it cannot be longer than 16
  249.       characters.
  250.  
  251.    SERVER=SERVERNAME/K
  252.  
  253.       SMBFS will attempt to connect to the file server by providing the name
  254.       you specified using the SERVICE command line parameter. In some cases
  255.       this may be undesirable as the server's name differs from what you
  256.       specified as the share name. You can use the SERVER parameter to tell
  257.       SMBFS under which name it should contact the server. This parameter is
  258.       optional and will be translated to all upper case characters; it cannot
  259.       be longer than 16 characters.
  260.  
  261.    DEVICE=DEVICENAME/K
  262.    VOLUME=VOLUMENAME/K
  263.  
  264.       The SMBFS program can announce itself as an AmigaDOS file system by
  265.       using one of two different methods.
  266.  
  267.       The first method involves announcing itself only as a file system
  268.       device. This should be sufficient in most cases but has a drawback in
  269.       that the device will not be usable from Workbench since the file system
  270.       will not appear as a disk icon. You tell SMBFS to use a specific device
  271.       name by using the DEVICE command line parameter, e.g. "DEVICE=SMBFS:".
  272.       Note that device names must be unique, i.e. there must be no other
  273.       device by the same name in the system; SMBFS will report an error and
  274.       exit if it finds one.
  275.  
  276.       The second method involves announcing itself as a volume. This has the
  277.       benefit of making the file system usable from Workbench since a disk
  278.       icon will appear for it. You tell SMBFS to use a specific volume name by
  279.       using the VOLUME command line parameter, e.g. "VOLUME=Sourcery:".
  280.  
  281.       Both methods have advantages and drawbacks. The drawback of the VOLUME
  282.       method is that it may deadlock the native Amiga Samba port as soon as
  283.       the file system is mounted. The drawback of the DEVICE method is that
  284.       the file system will not be usable from Workbench.
  285.  
  286.       If you wish, you can combine both methods; this is the approach most
  287.       other file systems use. And in fact, when you tell SMBFS to add a
  288.       volume it will also add a device to go along with it.
  289.  
  290.       The VOLUME and DEVICE keywords are optional; if you omit both, SMBFS
  291.       will pretend that you had used the "DEVICE=SMBFS:" parameter.
  292.  
  293.    CACHE=CACHESIZE/N/K
  294.  
  295.       The file system attempts to optimize accesses to the file server when
  296.       directory contents are being scanned. These contents are buffered in
  297.       a directory cache which by default will hold 170 entries. Since each
  298.       entry will require about 255 bytes of storage, the entire 170 entry
  299.       cache will occupy more than 40K bytes of memory. You may want to change
  300.       this requirement, by making the cache smaller or larger using the
  301.       CACHESIZE parameter. The size of the directory cache cannot be smaller
  302.       than 10 entries.
  303.  
  304.    DEBUGLEVEL=DEBUG/N/K
  305.  
  306.       By default SMBFS operates in silent mode. It does not report what it is
  307.       doing, it just tries to respond to file system requests. To obtain
  308.       debugging output you may want to use the DEBUG option and specify a
  309.       debug level greater than 0. The larger the number you specify the more
  310.       debugging output will be created. Note that all debugging output will be
  311.       produced using the operating system's debug output functionality which
  312.       requires that you have a capturing program like 'Sashimi' running in the
  313.       background.
  314.  
  315.    TZ=TIMEZONEOFFSET/N/K
  316.  
  317.       By default the file system will use the current Locale settings to
  318.       translate between the local time and the time used by the SMB
  319.       server. For some configurations, however, this is impractical since
  320.       the server's time zone is not configured properly. For these
  321.       rare cases you may want to hard code a certain time zone offset
  322.       using the 'TIMEZONEOFFSET' options. The number you provide must
  323.       be the number of minutes to add to the local time in order to
  324.       translate it into the corresponding GMT value. For example, in
  325.       central Europe using CET, you would use "TZ=-60" since CET is
  326.       one hour ahead of GMT.
  327.  
  328.    TRANSLATE=TRANSLATIONFILE/K
  329.  
  330.       The Amiga and the file server SMBFS connects to may not share the same
  331.       character set. International characters used in file names on either
  332.       side may not come out correctly on the other side. To remedy this
  333.       problem, you can resort to file name translation. How the individual
  334.       names are to be translated is determined by the contents of a file
  335.       name translation table file such as the ones that ship with Workbench
  336.       in the "L:FileSystem_Trans" drawer. The first 256 bytes of each such
  337.       file must consist of the mapping of Amiga characters to the different
  338.       character set, and the second 256 characters must describe a mapping
  339.       back from the different character set to the Amiga. In most cases the
  340.       "L:FileSystem_Trans/INTL.crossdos" translation table file should be
  341.       sufficient. To specify which file contains the translation tables to
  342.       use you would use the TRANSLATIONFILE parameter.
  343.  
  344.    SERVICE/A
  345.  
  346.       This is the last parameter to be specified on the command line. It
  347.       should refer to the file server you want to connect to and the resource
  348.       it exports, e.g. a file system. This parameter must start with two
  349.       slashes which must be immediately followed by the file server's name,
  350.       which must be followed by the resource to connect to.
  351.  
  352.       For now no special characters are allowed in the name of the service
  353.       as no translation is performed like would be the case for file names
  354.       on the volume.
  355.  
  356. The same parameters are also used when starting SMBFS from Workbench. SMBFS
  357. will examine its icon tool types and use these in place of the shell command
  358. line.
  359.  
  360.  
  361. 6. Known problems
  362.  
  363. The design of smbfs follows the original file system concept behind the
  364. code which the 'Sharity-Light' file system is based upon. And that is a
  365. Unix file system which differs from Amiga specific file systems in many
  366. ways which can lead to problems which are discussed briefly below:
  367.  
  368.    - Single threaded design
  369.  
  370.      This means that it is not possible for several programs to fairly
  371.      share the use of the file system. For example, a program that posts
  372.      a long read request can tie up the file system almost exclusively
  373.      for itself, and while it is busy all other clients will have to
  374.      wait. Same goes for directory scanning.
  375.  
  376.    - Poor scalability
  377.  
  378.      This is associated with the single threaded design. When several
  379.      programs are accessing the file system at the same time, overhead
  380.      and unfair sharing of resources will drastically reduce the
  381.      performance of the file system.
  382.  
  383.    - Separation of file data and metadata
  384.  
  385.      This means that the core of the file system treats the contents of
  386.      a directory and the data attached to each file inside that
  387.      directory as something different. This is a common concept with
  388.      Unix file systems, but it is very different with Amiga file systems.
  389.      In smbfs this data separation can cause problems when deleting
  390.      files from a directory while that directory is being scanned,
  391.      such as how this is being done by the 'Delete' shell command. The
  392.      effects of these problems are that a directory may not be deleted
  393.      even though it is empty or that for the same directory the same
  394.      file may be reported twice in the listing.
  395.  
  396. While there are no easy solutions for any of these problems, it does not
  397. mean that smbfs is unusable. You just have to be more careful when you
  398. use the file system. For example, if a directory's contents cannot be
  399. deleted due to one of the problems mentioned above, you might want to
  400. retry later.
  401.  
  402. It should be noted that the problems described above are not inherent
  403. to the original file system design. It's just that transferring that
  404. design to an Amiga file system created the problems.
  405.  
  406.  
  407. 7. Credits
  408.  
  409. This file system is based upon prior work by Paal-Kr. Engstad, Volker
  410. Lendecke, Mark A. Shand, Donald J. Becker, Rick Sladkey, Fred N. van Kempen,
  411. Eric Kasten and Rudolf Koenig. It is a direct descendant of the
  412. 'Sharity-Light' file system written by Christian Starkjohann.
  413.  
  414. The password encryption code was lifted from the Samba package. It was
  415. written by Andrew Tridgell and the Samba Team.
  416.  
  417.  
  418. 8. Author
  419.  
  420. The 'Sharity-Light' source code was adapted and wrapped into an AmigaOS layer
  421. by Olaf `Olsen' Barthel. If you wish to contact me, please send e-mail to the
  422. following address:
  423.  
  424.    olsen@sourcery.han.de
  425.  
  426. Or, alternatively, you might want to contact me via my postal address:
  427.  
  428.    Olaf Barthel
  429.    Brabeckstr. 35
  430.    D-30559 Hannover
  431.    Federal Republic of Germany
  432.  
  433. If you want to submit a bug report or an enhancement request, please enclose
  434. sufficient information to allow me to make sense of the problem. That includes
  435. debugging logs produced using the DEBUG option.
  436.  
  437.  
  438. 9. Source code
  439.  
  440. SMBFS is distributed under the terms of the GNU General Public License
  441. (version 2). The source code should have accompanied this program; if it
  442. hasn't, please contact the author for a copy.
  443.  
  444. The program was compiled using the SAS/C 6.58 compiler, with the Miami SDK
  445. providing for the TCP/IP stack API header files.
  446.